/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.model;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
*
* @author andersonribeiro
*/
@Entity
public class Reserva {
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int id;
	
	private boolean desalocado;

	private boolean pagamentoOK;

	@Temporal(TemporalType.DATE)
	private Calendar dataInicioDiaria;
	@Temporal(TemporalType.DATE)
	private Calendar dataFinalDiaria;
	
	private String status;
	
	@OneToMany(mappedBy = "reserva")
	private List<Hospede> hospedes = new ArrayList<Hospede>();

	@ManyToOne
	private Hotel hotel;

	@ManyToOne
	private Quarto quarto;
	
	public Reserva() {}

	public Reserva(Hospede hospede, Hotel hotel, Calendar dataInicioDiaria) {
		this.hotel = hotel;
		this.dataInicioDiaria = dataInicioDiaria;
		this.desalocado = false;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public boolean isDesalocado() {
		return desalocado;
	}

	public void setDesalocado(boolean desalocado) {
		this.desalocado = desalocado;
	}

	public boolean isPagamentoOK() {
		return pagamentoOK;
	}

	public void setPagamentoOK(boolean pagamentoOK) {
		this.pagamentoOK = pagamentoOK;
	}

	public Calendar getDataInicioDiaria() {
		return dataInicioDiaria;
	}

	public void setDataInicioDiaria(Calendar dataInicioDiaria) {
		this.dataInicioDiaria = dataInicioDiaria;
	}

	public Calendar getDataFinalDiaria() {
		return dataFinalDiaria;
	}

	public void setDataFinalDiaria(Calendar dataFinalDiaria) {
		this.dataFinalDiaria = dataFinalDiaria;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public List<Hospede> getHospedes() {
		return hospedes;
	}

	public void setHospedes(List<Hospede> hospedes) {
		this.hospedes = hospedes;
	}

	public Hotel getHotel() {
		return hotel;
	}

	public void setHotel(Hotel hotel) {
		this.hotel = hotel;
	}

	public Quarto getQuarto() {
		return quarto;
	}

	public void setQuarto(Quarto quarto) {
		this.quarto = quarto;
	}

}
